//服务器返回数据类型
export interface ResponseData{
    code:number,
    massage:string,
    ok:boolean
}

//spu数据类型
export interface spuData{
    id?:number|string,
    name:string,
    description:string,
    parentId:number,
    tmid:number|string,
    spuSaleAttrList:SaleAttr[],
    spuImageList:skuImageData[]
}

//数组，
export type Records=spuData[]
//获取已有spu数据接口返回的数据的ts类型
export interface HasSpuResponseData extends ResponseData{
    data:{
        records:Records,
        total:number,
        pages:number,
        pageNow:number
    }

}
//获取spu品牌数据ts类型
export interface spuTradeMarkData{
    _id:string,
    id: number,
    name:string,
    img_url: string,
    parentId:number
}
//存储sku品牌数组的ts类型
export type TradeMarkDatadata=spuTradeMarkData[]
//spu品牌数据返回类型
export interface spuTradeMarkResponseData extends ResponseData{
    data:TradeMarkDatadata
}
//获取sku图片ts类型
export interface skuImageData{
    _id?: string,
    id?: number,
    spuId?: number,
    createTimeDate?: string,
    createTime?: string,
    updateTime?: string,
    imgName?: string,
    imgUrl?: string,
    level?: number,
    url?:string,
    name?:string,
    response?:{
        code:number,
        message:string,
        url:string
    }


}
//sku图片数据返回类型
export interface skuImageResponseData extends ResponseData{
    data:skuImageData[]
}
//已有销售属性值对象ts类型
export interface SaleAttrValue{
    id?:number,
    spuId?:number,
    baseSaleAttrId:number|string,
    saleAttrName?:string,
    saleAttrValueName:string,
    createTimeDate?:string,
    createTime?:string,
    updateTime?:string,
    isChecked?:string
}
//存储已有销售属性值数组ts类型
export type  SpuSaleAttrValueList=SaleAttrValue[]
//已有销售属性对象ts类型
export interface SaleAttr{
    id?:number,
    spuId?:number,
    baseSaleAttrId:number|string,
    saleAttrName:string,
    createTimeDate?:string,
    createTime?:string,
    updateTime?:string,
    spuSaleAttrValueList:SpuSaleAttrValueList,
    flag?:boolean,
    saleAttrValue?:string,
    saleAttrOrSaleAttrValue?:string
}
//已有销售属性接口返回的数据ts类型
export interface SaleAttrResponseData extends ResponseData{
    data:SaleAttr[]
}
//全部销售属性ts类型
export interface BaseSaleAttr{
    id:number,
    name:string
}
//全部销售属性返回数据的ts类型
export interface BaseSaleAttrData extends ResponseData{
    data:BaseSaleAttr[]
}

export interface skuAttrValue{
    _id:number,
    attrId:number|string,
    valueId:number|string
}
export interface skuSaleAttrValue{
    saleAttrId:number|string,
    saleAttrvalueId:number|string
}
//sku的ts类型
export interface SkuData{
    parentId:string|number,
    spuId:string|number,
    tmid:string|number,
    skuName:string,
    price:string|number,
    weight:string|number,
    skuDesc:string,
    skuAttrValueList:skuAttrValue[],
    skuSaleAttrValueList:skuSaleAttrValue[],
    skuDefaultImg:string,
}
export interface ResponseSkuData extends ResponseData{
    data:SkuData[]
}